#ifndef PERSONAL_INFO_UI_H
#define PERSONAL_INFO_UI_H

#include <QGridLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QMouseEvent>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWidget>
#include "UserSession.h"
#include "ip_port.h"
class PersonalInfoUI : public QWidget
{
    Q_OBJECT

public:
    explicit PersonalInfoUI(QWidget *parent = nullptr);
    ~PersonalInfoUI();

    // Expose widgets if needed to the logic layer
    QLineEdit *getNicknameEdit() const;
    QLineEdit *getGenderEdit() const;
    QLineEdit *getBirthdayEdit() const;
    QLineEdit *getEmailEdit() const;
    QLineEdit *getSignatureEdit() const;
    QPushButton *getSaveButton() const;
    QPushButton *getAccountSecurityButton() const;
    QLabel *avatarLabel;

private:
    void setupUi();

    QLineEdit *nicknameEdit;
    QLineEdit *genderEdit;
    QLineEdit *birthdayEdit;
    QLineEdit *emailEdit;
    QLineEdit *signatureEdit;
    QPushButton *save;
    QPushButton *accountSecurityButton;

protected:
    void mousePressEvent(QMouseEvent *event) override; // 重写鼠标点击事件
    void closeEvent(QCloseEvent *event) override;
signals:
    void avatarLabelClicked();
      void windowClosed();
};

#endif // PERSONAL_INFO_UI_H
